home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
676-700
/
683
/
printfiles
/
deutsch
/
rexx
/
prf.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-18
|
2KB
|
75 lines
/* printfiles Arexx Macro */
/* © 1992 by K. Klingbeil */
/* fügt Dateinamen mittels pattern-matching in die */
/* Druckliste ein */
/* Befehl : rx prf [Einfügepattern] -r[Löschpattern] */
/* -f[ArexxMakro] */
/* Beispiel : rx prf #?.c #?.h -rtest#?.c -rtest.h */
/* fügt alle Dateien im aktuellen */
/* Verzeichnis, die auf .c oder .h enden in */
/* die Druckliste und löscht alle dateien */
/* die test im Namen mit der Endung .c */
/* und die Datei test.h */
/* ArexxMakro ist der Name eines Arexx-Programms, das */
/* dabei ausgeführt werden soll (z.B. für Voreinstell- */
/* ungen) */
/* Anmerkung: von Printfiles generierte Arexx-Programme*/
/* sollten das erste Argument sein, da sie zu Beginn */
/* einen reset-Befehl beinhalten */
/* Beispiel für die richtige Reihenfolge: */
/* rx prf -fPrintfiles.makro #?.c -rtest.c */
options results
if ~show(ports,'PRINTFILES')then do
address command 'printfiles'
end
if ~(show(ports,'PRINTFILES')) then return 5
parse arg CmdLine
p = words(CmdLine)
do i = 1 to p
pattern = word(CmdLine,i)
if left(pattern,2) == '-r' then removefile(substr(pattern,3))
else
if left(pattern,2) == '-f' then rxfile(substr(pattern,3))
else insertfile(pattern)
end
exit
rxfile: procedure
parse arg template
cmd = 'rx ' template
address command cmd
return 1
removefile: procedure
parse arg template
cmd = 'list >pipe:prf' template 'quick'
address command cmd
open('p','pipe:prf','r')
do while ~eof('p')
file = readln('p')
a = subword(file,1,1)
b = subword(file,2,1)
if a ~== '' & b == '' then address printfiles remfile a
end
close('p')
return 1
insertfile: procedure
parse arg template
cmd = 'list >pipe:prf' template 'quick'
address command cmd
open('p','pipe:prf','read')
do while ~eof('p')
file = readln('p')
a = subword(file,1,1)
b = subword(file,2,1)
if a ~== '' & b == '' then address printfiles insfile a
end
close('p')
return 1